<?php if(!isset($menu)){
    $menu=isset($this->leftMenu) ? $this->leftMenu : false;
} ?>
<?php if($menu): ?>

    <?php $end=array_keys($menu); $end=end($end); ?>

    <div class="leftmenu">
        <ul class="dropdown dropdown-vertical">
            <?php foreach($menu as $num=>$item): ?>
            <li class="<?php echo $num==$end ? 'lastchild' : 'dir'; ?>">
                <?php echo CHtml::link($item->name,$item->url); ?>
            </li>
            <?php endforeach; ?>
        </ul>
    </div>

<?php endif; ?>